<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap.min.css}">
    <style>
        .box{
            padding: 30px 25px 10px;
        }
        .form-group label{
            margin-top: 5px
        }
    </style>
</head>
<body>

<div class="box">
    <form class="form-horizontal" method="post" id="senInformationForm">
        <div class="form-group">
            <div class="col-xs-9">
                <textarea rows="6" cols="50" id="advice" name="advice" required class="form-control" ></textarea>
            </div>
        </div>

        <div class="form-group">
            <div class="col-xs-offset-3 col-xs-9">
                <input type="button" value="提交" class="btn btn-primary" onclick="senAdvice();"/>
                <input type="button" value="取消" class="btn btn-warning" onclick="parent.closeWindow();"/>
            </div>
        </div>
    </form>
</div>

</body>
<script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script>
<script th:inline="javascript">
    $(function () {
        var message = [[${msg}]];
        if (message != null && message != "") layer.msg(message);
    });

    /**
     * 提交意见
     */
    function senAdvice() {
        $.ajax({
            type: 'POST',
            url: "/app/sendAdviceOrMessage",
            data:  {
                content: $("#advice").val(),
                type : 1
            },
            success: function (result) {
                if (result.msg == 200) {
                    parent.getAdviceOrMassage();
                    parent.successClose("提交成功");
                } else {
                    layer.msg(result.msg);
                }
            }
        });
    }

</script>
</html>